home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 8
/
The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO
/
g_quake
/
dropde-2.zip
/
FLAME.QC
< prev
next >
Wrap
Text File
|
1996-09-17
|
5KB
|
204 lines
/*
============================================================================
Quake Flamethrower 1.0
Another groovy patch from Quake Command - http://www.nuc.net/quake
QC Code By : Steve Bond wedge@nuc.net
Apologies in advance... I was unable to comment this as well as I'd have
liked to. (I used some weird variable names - hope they don't cause problems.
============================================================================
*/
// Internal declaration
void (vector fireorg) SpawnTouchFlame;
void () BurnThem;
// Player.qc declaration
void () DeathBubblesSpawn;
// Slightly varied version of DEATHBUBBLES
void(float num_bubbles, vector bub_origin) NewBubbles =
{
local entity bubble_spawner;
bubble_spawner = spawn();
setorigin (bubble_spawner, bub_origin);
bubble_spawner.movetype = MOVETYPE_NONE;
bubble_spawner.solid = SOLID_NOT;
bubble_spawner.nextthink = time + 0.1;
if (self.classname == "player")
bubble_spawner.owner = self;
else
bubble_spawner.owner = self.firelink;
bubble_spawner.think = DeathBubblesSpawn;
bubble_spawner.bubble_count = num_bubbles;
return;
};
/*
===============
Burn Them!
===============
*/
void () BurnThem =
{
local entity wood;
wood = self.firelink;
if ( !(wood.flags & FL_ONFIRE) )
{
wood.effects = wood.effects - (wood.effects & EF_DIMLIGHT);
sound(wood, CHAN_FIRE, "hknight/hit.wav", 0.5, ATTN_NORM);
remove(self);
}
else if (wood.waterlevel >= 1)
{
NewBubbles(6, wood.origin);
sound (wood, CHAN_FIRE, "misc/water2.wav", 1, ATTN_NORM);
wood.effects = wood.effects - EF_DIMLIGHT;
wood.flags = wood.flags - FL_ONFIRE;
remove(self);
}
else
{
local vector org;
org = wood.origin;
org_z = org_z + ((wood.maxs_z + wood.mins_z) * 0.5) - 2;
SpawnTouchFlame(org);
if (wood.classname == "monster_demon1")
T_Damage (wood, self, self.owner, 0.5);
else
T_Damage (wood, self, self.owner, 1);
self.nextthink = time + 0.25;
}
};
/*
================
SpawnTouchFlame
================
*/
void (vector fireorg) SpawnTouchFlame =
{
local entity flame;
flame = spawn ();
flame.owner = self;
flame.movetype = MOVETYPE_FLYMISSILE;
flame.velocity = '0 0 75';
flame.solid = SOLID_NOT;
flame.classname = "fire";
flame.origin = fireorg;
flame.think = s_explode1;
flame.nextthink = time;
setmodel (flame, "progs/s_explod.spr");
setsize (flame, '0 0 0', '0 0 0');
};
/*
================
FlameTouch
================
*/
void () FlameTouch =
{
if (other == self.owner)
return;
if (other.takedamage)
{
local vector org;
org = other.origin;
org_z = org_z + ((other.maxs_z + other.mins_z) * 0.5) - 2;
SpawnTouchFlame(org);
if (other.classname == "monster_demon1")
T_Damage (other, self, self.owner, 4);
else
T_Damage (other, self, self.owner, 8);
// If target not gibbed or on fire, 20% chance of catching fire.
if (other.takedamage && !(other.flags & FL_ONFIRE) && random() < 0.2)
{
// Fire stays with whatever it hits
if (other.classname == "player")
{
centerprint(other,"You are on fire! Find WATER!\n");
stuffcmd (other,"bf\n");
}
other.flags = other.flags | FL_ONFIRE;
sound(other, CHAN_FIRE, "ambience/fire1.wav", 0.75, ATTN_STATIC);
self.firelink = other;
self.think = BurnThem;
self.nextthink = time;
self.solid = SOLID_NOT;
setmodel (self,"");
other.effects = other.effects | EF_DIMLIGHT;
}
else
remove (self);
}
else if (other == world)
{
self.velocity = '0 0 0';
}
};
/*
================
W_FireFlame
================
*/
void() W_FireFlame =
{
local entity flame;
if (self.waterlevel > 2)
{
makevectors (self.v_angle);
NewBubbles(2, self.origin+v_forward*64);
if (random() < 0.5)
sound (self, CHAN_WEAPON, "misc/water1.wav", 1, ATTN_NORM);
else
sound (self, CHAN_WEAPON, "misc/water2.wav", 1, ATTN_NORM);
return;
}
// Take away a little rocket fuel
self.currentammo = self.ammo_rockets = self.ammo_rockets - 0.2;
sound (self, CHAN_WEAPON, "hknight/hit.wav", 1, ATTN_NORM);
flame = spawn ();
flame.owner = self;
flame.movetype = MOVETYPE_FLYMISSILE;
flame.solid = SOLID_BBOX;
flame.classname = "fire";
// set flame speed
makevectors (self.v_angle);
flame.velocity = aim(self, 10000);
flame.velocity = flame.velocity * 300;
flame.touch = FlameTouch;
flame.think = s_explode1;
flame.nextthink = time + 0.15;
setmodel (flame, "progs/s_explod.spr");
setsize (flame, '0 0 0', '0 0 0');
setorigin (flame, self.origin + v_forward * 16 + '0 0 16');
};